package cn.i7baozh.nacos.config.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * @Title:
 * @Description:
 * @author: baoqi.zhang
 * @date: 2022/4/13 17:39
 */
@Slf4j
@RestController
@RefreshScope
public class ConfigClientController {

    @Value("${config.value}")
    private String value;

    @PostConstruct
    public void init() {
        log.info("*************** {}", value );
    }
    @GetMapping("config/client/get")
    public String getValue() {
        log.info("current:{}", value);
        return value;
    }
}
